home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Games / flying-6.11 / global.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-19  |  5.8 KB  |  207 lines

  1. #ifndef    _global_h
  2. #define    _global_h
  3.  
  4. // Directory, in which to put the bitmap files for deluxe-playing
  5. #ifdef ANCILLA
  6. #define    DATA_DIRECTORY        "/u/games/lib/flying-6.11/fly.dta"
  7. #endif
  8.  
  9. #ifdef SKUNKWARE
  10. #define    DATA_DIRECTORY        "/usr/games/lib/flying-6.11/fly.dta"
  11. #endif
  12.  
  13. // name of the file to look for static data of the classes
  14. #define    PRESET_FILE            "presets.txt"
  15.  
  16. #define    LOG_FILE                DATA_DIRECTORY"/logfile.txt"
  17.  
  18. //
  19. // As an optimization, every DynObj gets a storage for caching the calculated
  20. // collision-times with other objects. At the moment of a collision, only
  21. // the 2 objects taking part in the collision have to update their cache
  22. // and probably inform other objects about their changes.
  23. #define    TIME_CACHE        1
  24.  
  25. //
  26. // The collision detection can be aborted at an early stage, when a minimum
  27. // time can be estimated which lies beyond a limit.
  28. // Problem: - The check, if to abort, already takes too much time.
  29. //          - When time-caching is on, advanced collision times, which aren't
  30. //            of any use at the moment of calculation, might be used later on.
  31. #define    ABORT_CALC        0
  32. #if (ABORT_CALC)
  33. #    define    ABORT_CALC_WALL    0
  34. #    define    ABORT_CALC_BALL    0
  35. #endif
  36.  
  37. //
  38. // The basic floating point class can be exchanged between doubles and
  39. // floats. The latter one is faster on my 386.
  40. #ifndef __TURBOC__
  41. #    define    REAL_IS_FLOAT    0
  42. #else
  43. #    define    REAL_IS_FLOAT    1
  44. #endif
  45.  
  46. //
  47. // A real C++-Class can be used for real arithmetic. Unfortunately
  48. // that really slows the calculation down, even though the whole class
  49. // is defined inline.
  50. #define    REAL_IS_CLASS    0
  51.  
  52. //
  53. // There are some specialized vector classes for 2 and 3 dimensional
  54. // vectors, which can also be realized by inheriting from an universal
  55. // vector-class (but again, that's expensive)
  56. #define    Vec2IsVector    0
  57. #define    Vec3IsVector    0
  58.  
  59. //
  60. // Switch to pre-existing (better to understand) algorithms for
  61. // collision detection, instead of the special algortithm (which is
  62. // a bit faster).
  63. #define    EasyWall        0
  64.  
  65. //
  66. // special constants instead of the collision time
  67. #define    MAX_TIME                1e10
  68. #define    NO_HIT                MAX_TIME
  69. #define    NO_TARGET            MAX_TIME
  70. #define    RUNNING_LOSE        4e10
  71. #if (ABORT_CALC)
  72. #    define    NOT_REACHABLE    2e10
  73. #endif
  74.  
  75. //
  76. // constants to overcome the problem with unprecise real-arithmetics
  77. #if (REAL_IS_FLOAT)
  78. #    define    EPS             1e-4
  79. #else
  80. #    define    EPS             1e-10
  81. #endif
  82.  
  83. //
  84. // current time in calculation
  85. // not to mix up with the realtime of GetCurrentTime()
  86. //
  87. extern double    current_time;
  88.  
  89. #ifndef __TURBOC__
  90. #    define    _DEBUG
  91. #endif
  92. //
  93. // debugging switches, the main switch DEBUG enables all successive
  94. // options, mainly leading to traces on stdout
  95. #ifdef DEBUG
  96.  
  97. #include <stdio.h>
  98. #include <stdlib.h>
  99. #include <string.h>
  100.  
  101. extern long        debug;                // Variable der anzuzeigenden modes
  102. #define    ShowLight            0x00000001l
  103. #define    ShowColors            0x00000002l
  104. #define    ShowRings            0x00000004l
  105. #define    ObjectInfo            0x00000008l
  106. #define    BeforCollision        0x00000010l
  107. #define    AfterCollision        0x00000020l
  108. #define    CheckBoundary        0x00000040l
  109. #define    MoveAll                0x00000080l
  110. #define    __Moves                0x000000f8l
  111. #define    PBallHit                0x00000100l
  112. #define    PointerMove            0x00000200l
  113. #define    XWallHit          0x00000400l
  114. #define    YWallHit                0x00000800l
  115. #define    CollCalc                0x00001000l
  116. #define    AbortCalc            0x00002000l
  117. #define    AbortReCalc            0x00004000l
  118. #define    StickLevel            0x00008000l
  119. #define    GameState            0x00010000l
  120. #define    BMover                0x00020000l
  121. #define    BState                0x00040000l
  122. #define    Sync                    0x00080000l
  123. #define    ShowTurns            0x00100000l
  124. #define    Loops                    0x00200000l
  125. #define    __ShowAll            0x00100007l
  126. #define    __Rings                0x00100004l
  127. #define    Intro                    0x00400000l
  128. #define    xdb               0x00800000l
  129. #define    xwd               0x02000000l
  130. #define  ForceCalc         0x01000000l
  131. #define  Motion                0x04000000l
  132.  
  133. #define    TCTrace                0x40000000l
  134. #define    UnixTrace            0x80000000l
  135.  
  136. #define    ShowSubWindow        (ShowLight|ShowColors|ShowRings|ShowTurns)
  137.  
  138. #define    DBG0(m,f)            if (debug&m)    printf( f )
  139. #define    DBG1(m,f,a)            if (debug&m)    printf( f,a )
  140. #define    DBG2(m,f,a,b)        if (debug&m)    printf( f,a,b )
  141. #define    DBG3(m,f,a,b,c)    if (debug&m)    printf( f,a,b,c )
  142. #define    DBG4(m,f,a,b,c,d)    if (debug&m)    printf( f,a,b,c,d )
  143.  
  144. int set_debug( const char *flag_name );
  145. void show_flags();
  146.  
  147. #else
  148.  
  149. #define    DBG0(m,f)
  150. #define    DBG1(m,f,a)
  151. #define    DBG2(m,f,a,b)
  152. #define    DBG3(m,f,a,b,c)
  153. #define    DBG4(m,f,a,b,c,d)
  154.  
  155. #endif
  156.  
  157. #include "stdinc.h"
  158.  
  159. //
  160. // Fⁿr Zeitmessungen kann das Zeichnen der sich bewegenden BΣlle komplett
  161. // unterdrⁿckt werden, indem die DrawCircle()-Funktion durch eine leere
  162. // Funktion ersetzt wird.
  163. #define    STATISTICS
  164. #define    _NO_DRAW
  165.  
  166. //
  167. // Reibungsimplementierung, in dem schrittweise
  168. // die Geschwindigkeit verkleinert wird. Das Problem ist allerdings, das mit
  169. // jedem Schritt die Zeiten des TIME-CACHE ungⁿltig werden, und daher
  170. // nicht zu viele Schritte pro Sekunden eingelegt werden sollten.
  171. // Die Parametrierung der Reibung und der Aufl÷sung der Schrittberechnung
  172. // geschieht durch virtuelle Funktionen der Game-Klasse
  173. //
  174. // Einschalten der Reibungssimulation durch stufige Verlangsamung:
  175. #define SIM_SLOW                1
  176.  
  177. #if (SIM_SLOW)
  178. #    define    SUPPRESS_SLOWSTEP        -1.0
  179. #endif
  180.  
  181.  
  182. // ===========================================================================
  183. //   'Wissenswertes' aus verschiedenen Bereichen (reduziert AbhΣngigkeiten)
  184. // ===========================================================================
  185.  
  186. extern double w2n;                    // Fensterskalierung                (graph.C)
  187.  
  188. typedef long ColorId;
  189.  
  190.  
  191. #define    SOUND_SUBSYSTEM    1
  192. #if (SOUND_SUBSYSTEM)
  193. extern    int sound_request;    // sound einschalten                            (main.C)
  194. #endif
  195. extern    int size;                // gewⁿnschte (aktuelle) Fenstergr÷▀e    (main.C)
  196. extern    int deluxe;                // Luxus-Flag                          (main.C)
  197. extern    int light_flag;        // Light-Sources                                (main.C)
  198. extern    int color_flag;        // table color                                    (main.C)
  199. extern    int nohint_flag;        // aiming hint                                    (main.C)
  200. #define    ON_ROOT        -1
  201.  
  202.  
  203. void show_defaults();
  204. void load_konfi();
  205.  
  206. #endif
  207.